#include "stdafx.h"
#include <string>
#include <windows.h>

#include <Inklude/ikCString.h>
#include <Inklude/ikCSharedMemory.h>

using namespace Inklude;
using namespace std;

int main(int argc, char** argv)
{
    ikCSharedMemory cmem;
    cmem.CreateMemory(Inklude::ikCString("abcdefg"), 512);

    char buffer[512];

    static int index;

    while (true)
    {
        index++;
        sprintf(buffer, "%d th message\n", index);
        cmem.WriteMemory(buffer, 100, 0);

        sprintf(buffer+200, "%d th message in mem address 200\n", index);
        cmem.WriteMemory(buffer+200, 100, 200);

        printf(buffer);
        printf(buffer+200);
        printf("\n");

        Sleep(100);
    }
}

